<template lang="html">
  <div class="lion2">
    <!-- loading页面 -->
    <div id="loading_box2" v-if="bol">
       <Row>
       <Col class="demo-spin-col" span="8">
               <Spin fix>
                   <Icon type="load-c" size=18 class="demo-spin-icon-load"></Icon>
                   <div>Loading</div>
               </Spin>
          </Col>
       </Row>
    </div>
    <div v-else>
      <!-- 头部 -->
      <div class="ser_con2" :class="{ 'flagk-active': flag}">
        <img src="../../static/imgs/left2.png" alt="" @click="back()">
        <p v-show="b" class="mid2">{{msg.mergeProductName}}</p>
        <div class="telS2">
           <img src="../../static/imgs/share2.png" @click="isShow2_2()" alt="">
           <img src="../../static/imgs/tel2.png" @click="isShow2()" alt="">
        </div>
    	</div>
      <div class="flag2" v-show="isShow">
        <div class="flag2Wrap">
          <p>呼叫凯撒旅游服务热线</p>
          <p>10086转1团队游业务</p>
          <ul>
            <li><a href="tel:10086">呼叫</a></li>
            <li @click="isHidden2()"><a href="javascript:void(0)">取消</a></li>
          </ul>
        </div>
      </div>
      <!-- 分享链接 -->
      <div class="flag2" v-show="isShow_2">
        <div class="flag2Wrap2">
          <div class="share2">
            <!-- 新浪微博 -->
            <dl class="shareSina2" @click="shareSina()">
              <dt><img src="../../static/weibo.png" /></dt>
              <dd>微博</dd>
            </dl>
            <!-- qq空间 -->
            <dl class="shareQQzone" @click="qqzone()">
              <dt><img src="../../static/qznp.png" /></dt>
              <dd>QQ空间</dd>
            </dl>
            <!-- qq -->
            <dl class="" @click="qq()">
              <dt><img src="../../static/qq.png" /></dt>
              <dd>QQ</dd>
            </dl>
            <!-- 腾讯微博 -->
            <dl class="" @click="qqweibo()">
              <dt><img src="../../static/tengxun.png" /></dt>
              <dd>腾讯微博</dd>
            </dl>
          </div>
          <p @click="isHidden2_2()">取消</p>
        </div>
      </div>
      <!-- 回到顶部 -->
      <gotop></gotop>
      <!-- 轮播图 -->
      <div class="awiper">
        <swiper class="swip_2" :options="swiperOption" ref="mySwiper">
          <!-- 这部分放你要渲染的那些内容 -->
          <swiper-slide v-for="(item,index) in msg.pictures">
              <img :src="item.url" class="index_img2">
          </swiper-slide>
          <!-- 这是轮播的小圆点 -->
          <div id="yuandian2" class="swiper-pagination yuandian2" slot="pagination"></div>
        </swiper>
        <p class="proNo">产品编号：{{msg.productCode}}</p>
      </div>
      <!-- 介绍 -->
      <div class="compare2">
        <p>{{msg.mergeProductName}}</p>
        <p>{{msg.subTitle}}</p>

        <div class="lion2M">
          <div>
            <p><strong>￥{{msg.lowestAdultPrice}}</strong>起<img src="../../static/imgs/new2.png" /><i>最后{{msg.remain}}席</i></p>
            <p>零售价<del>￥{{msg.fullPrice}}</del>/人；儿童价￥{{msg.lowestChildPrice}}/人</p>
          </div>
          <!-- <div>
            <img src="../../static/imgs/add2_2.png" />
            <p>对比</p>
          </div> -->
        </div>
        <p><i v-for="(item,index) in msg.labels">{{item}}</i></p>
      </div>
      <!-- 出发时间 -->
      <div class="time2">
        <div class="timeUp">
          <img src="../../static/imgs/time2.png" alt="">
          出发日期<img src="../../static/imgs/right2.png" alt="">
        </div>
        <div class="timeDown">
          <ul>
            <li>
              <p>11-16周四</p>
              <p>￥3288</p>
            </li>
            <li>
              <p>11-23周四</p>
              <p>￥2988</p>
            </li>
            <li>
              <p>11-28周二</p>
              <p>￥3288</p>
            </li>
            <li>
              <p>12-07周四</p>
              <p>￥3288</p>
            </li>
          </ul>
          <ul>
            <li>
              <p>12-15周五</p>
              <p>￥3288</p>
            </li>
            <li>
              <p>12-19周二</p>
              <p>￥3288</p>
            </li>
            <li>
              <p>12-21周四</p>
              <p>￥3288</p>
            </li>
            <li>
              <p>12-28周四</p>
              <p>￥3288</p>
            </li>
          </ul>
        </div>
      </div>
      <!-- 列表 -->
      <div class="lists2">
        <ul>
          <li>
            <img src="../../static/imgs/pos2.png" alt="">
            出发城市<span>{{msg.departureName}}</span>
          </li>
          <li>
            <img src="../../static/imgs/per2.png" alt="">
            团队规模<span><i>{{msg.isSmallGroup}}</i>团队总人数{{msg.teamTotal}}人</span>
          </li>
          <li>
            <img src="../../static/imgs/star2_1.png" alt="">
            产品人气<span><i>{{msg.favoriteNum}}</i>人想去</span>
          </li>
        </ul>
      </div>
      <!-- 模块切换 -->
      <div class="routerChange2" id="routerChange2">
        <div class="rou2" :class="{'router-link-active':isrou1}" @click="rou2_1()" >产品特色
        </div>
        <div class="rou2" :class="{'router-link-active':isrou2}" @click="rou2_2()">线路详情</div>
        <div class="rou2" :class="{'router-link-active':isrou3}" @click="rou2_3()">签证信息</div>
        <div class="rou2" :class="{'router-link-active':isrou4}" @click="rou2_4()">签证信息</div>
      </div>
      <product :obj="chara" :obj2="daily" v-show="isrou1"></product>
      <lines :obj="chara" :obj2="daily" :obj5="flightInfo" v-show="isrou2"></lines>
      <news v-show="isrou3"></news>
      <fei :obj3="optionalItem" :obj4="shceduleStore" :obj6="scheduleService" v-show="isrou4"></fei>
      <!-- 服务流程 -->
      <div class="server2">
        <img src="http://m.caissa.com.cn/group//static/images/h5/step.png" alt="">
      </div>
      <!-- 相关推荐 -->
      <div class="relative2">
        <p><img src="../../static/imgs/zan2.png" alt=""/>相关推荐</p>
        <relate></relate>
      </div>
      <div class="bottom2">
        <div class="" v-if="username">
          <div v-if="noSelect">
            <div class="xiangqu">
              <img src="../../static/imgs/star2_3.png" alt="">
              <p>想去</p>
            </div>
          </div>
          <div v-else>
            <div class="xiangqu" >
              <img src="../../static/imgs/xing2.png" alt="">
              <p>想去</p>
            </div>
          </div>
        </div>
        <div v-else @click="select()">
          <router-link to="/mine">
            <div class="xiangqu">
              <img src="../../static/imgs/star2_3.png" alt="">
              <p>想去</p>
            </div>
          </router-link>
        </div>

        <div class="">
            <img src="../../static/imgs/kefu.png" alt="">
            <p>在线咨询</p>
        </div>
        <div class="">
          <img src="../../static/imgs/car2.png" alt=""><span>立即预定</span>
          <h1>{{obj}}</h1>
        </div>
      </div>
    </div>
  </div>

</template>

<script>
import Vue from 'vue'
import home from '../pages/home'
import relate from '../components/relate'
// 产品
import product from '../components/product'
// 费用
import fei from '../components/fei'
// 路线
import lines from '../components/line'
// 签证信息
import news from '../components/news'

import upback from '../components/upBack'
import gotop from '../components/goTop'
// 导入轮播图组件
import { swiper, swiperSlide } from 'vue-awesome-swiper'

import bus from '../js/bus'
// localStorage插件
// import localStorage from '../js/localStorage'
export default {
  props:['obj'],
  components:{
    swiper,
    swiperSlide,
    relate,
    upback,
    gotop,
    product,
    lines,
    news,
    fei
   },
  data(){
    return{
      isrou1:true,
      isrou2:false,
      isrou3:false,
      isrou4:false,
      isflag:true,
      noSelect:true,
      b:false,
      bol:true,
      flag:false,
      isShow:false,
      isShow_2:false,
      want:'',
      scroll:'',
      url:'',
      username:'',
      msg:{},
      chara:{},
      daily:{},
      optionalItem:{},
      shceduleStore:{},
      flightInfo:{},
      scheduleService:{},
      swiperOption: {
        notNextTick: false,
        pagination: '.swiper-pagination',
        slidesPerView: 'auto',
        centeredSlides: true,
        autoplay: 3000,
        paginationClickable: true,
        preventClicks: false,
        autoplayDisableOnInteraction:false,
        onSwiping: false
      },
      item:{}
    }


  },
  watch:{
    '$route'(){
      console.log("jian");
      this.isflag = false;
  }
},

  methods: {
     menu() {
      this.scroll = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
        if (this.scroll > window.screen.availHeight/4) {
        this.flag = true;
        this.b=true;
        }else {
        this.flag = false;
        this.b=false;
        }
      },
      back(){
        history.back()
      },
      isShow2(){
        this.isShow=true
      },
      isHidden2(){
        this.isShow=false
      },
      isShow2_2(){
        this.isShow_2=true
      },
      isHidden2_2(){
        this.isShow_2=false
      },
      select(){
        this.noSelect=false
        // localStorage.setItem("want",this.noSelect)
          console.log("dianji" + this.$store.getters.man);
        this.$store.commit('SET_ITEMS', this.$store.getters.man)


      },
      // 切换四个小路由显示隐藏
      rou2_1(){
        this.isrou1=true
        this.isrou2=false
        this.isrou3=false
        this.isrou4=false
      },
      rou2_2(){
        this.isrou1=false
        this.isrou2=true
        this.isrou3=false
        this.isrou4=false
      },
      rou2_3(){
        this.isrou1=false
        this.isrou2=false
        this.isrou3=true
        this.isrou4=false
      },
      rou2_4(){
        this.isrou1=false
        this.isrou2=false
        this.isrou3=false
        this.isrou4=true
      },
      //分享到新浪微博
      shareSina(){
        var sharesinastring = 'http://service.weibo.com/share/share.php?title='+'王凯可帅了'+'&url='+'http://localhost:8080/#/lion';
        window.location.href = sharesinastring;
      },
      // 分享到qq空间
      qqzone(){
        // var p = {
        //     url:location.href,
        //     showcount:'0',/*是否显示分享总数,显示：'1'，不显示：'0' */
        //     desc:'',/*默认分享理由(可选)*/
        //     summary:'',/*分享摘要(可选)*/
        //     title:'',/*分享标题(可选)*/
        //     site:'',/*分享来源 如：腾讯网(可选)*/
        //     pics:'', /*分享图片的路径(可选)*/
        //     style:'203',
        //     width:98,
        //     height:22
        //   };
          //分享到QQ空间
          var sharesinastring = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?title= ' + '666' + '&url=' + 'http://localhost:8080/#/lion';
          window.location.href = sharesinastring;
      },
      // 分享给qq好友
      qq(){
        //   var p = {
        //   url: location.href, /*获取URL，可加上来自分享到QQ标识，方便统计*/
        //   desc: '', /*分享理由(风格应模拟用户对话),支持多分享语随机展现（使用|分隔）*/
        //   title: '', /*分享标题(可选)*/
        //   summary: '', /*分享摘要(可选)*/
        //   pics: '', /*分享图片(可选)*/
        //   flash: '', /*视频地址(可选)*/
        //   site: '', /*分享来源(可选) 如：QQ分享*/
        //   style: '201',
        //   width: 32,
        //   height: 32
        //   };
        //   //分享到QQ
          var sharesinastring = 'http://connect.qq.com/widget/shareqq/index.html?title=' + '666' + '&url=' + 'http://localhost:8080/#/lion';
          window.location.href = sharesinastring;
      },
      qqweibo(){
        //   var p = {
        //   url: location.href, /*获取URL，可加上来自分享到QQ标识，方便统计*/
        //   title: '', /*分享标题(可选)*/
        //   pic: '', /*分享图片(可选)*/
        //   site: '' /*分享来源(可选) 如：QQ分享*/
        //   };
        //   //分享到腾讯微博
          var sharesinastring = 'http://v.t.qq.com/share/share.php?title=' + '666' + '&url=' + 'http://localhost:8080/#/lion';
          window.location.href = sharesinastring;
      }
    },
  mounted() {
   window.addEventListener('scroll', this.menu)
  },
  created(){
    console.log(localStorage.getItem('item'));
    this.item = localStorage.getItem('item');
    console.log("item" + this.item);
    this.username = localStorage.getItem('user');
    console.log(this.username);
    this.want = localStorage.getItem('want');
    this.noSelect = this.want;
    // console.log(this.username);
    bus.$on('datas', (data)=> {
        console.log(data);
        console.log(this.isrou1);
        this.isrou1=false
        this.isrou2=false
        this.isrou3=false
        this.isrou4=true
    });
    // 数据获取接口
    this.axios.get('http://txspring.cn:8080/getLion').then(data=>{
      console.log(data.data.resultmsg.code);
      if (data.data.resultmsg.code == "0") {
        this.msg=data.data.data;
        this.chara=this.msg.characteristic;
        this.daily=this.msg.dailySchedule;
        this.optionalItem=this.msg.optionalItem;
        this.shceduleStore=this.msg.shceduleStore;
        this.flightInfo=this.msg.flightInfo;
        this.scheduleService=this.msg.scheduleService;

      } else {
        alert(data.data.resultmsg.msg);
      }
      this.swiperOption.loop = true;
    }).catch(function (error) {
       console.log(error);
     });
    setTimeout(()=>{
      this.bol = false;
    },500);
}
}
</script>

<style lang="css">
  .lion2{
    text-align: left;
    font-size: 1.2rem;
    background: #f5f5f5;
    overflow: hidden;
  }
  .swip_2{
    width: 100%;
    height: 19rem;
    position: relative;
  }
  #yuandian2{
    position: absolute;
    bottom: 0;
    padding-right: 1.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  .yuandian2{
    padding: 0.6rem 0;
    padding-left: 66.1%;
    background: rgba(0, 0, 0, 0.5);
    position: absolute;
    bottom: 0;
  }
  #yuandian2 .swiper-pagination-bullet{
    background-color: #fff;
  }
  .proNo{
    color: #fff;
    position: absolute;
    top: 17rem;
    left:1.5rem;
    z-index: 20;
  }
  .index_img2{
    width: 100%;
    height: 100%;
  }
  .compare2{
    padding: 1.5rem;
    background: #fff;
  }
  .compare2>p:nth-of-type(1){
    font-size: 1.6rem;
    color: #000;
  }
  .compare2>p:nth-of-type(2){
    color: #999;
  }
  .lion2M{
    display: flex;
    justify-content: space-between;
  }
  .lion2M>div:nth-of-type(1){
    color: #999;
    padding: 1rem 0;
  }
  .lion2M>div:nth-of-type(1)>p:nth-of-type(1)>strong{
    color: #ff6b01;
    font-size: 2rem;
  }
  .lion2M>div:nth-of-type(1)>p:nth-of-type(1)>img{
    margin: 0 0.3rem;
    width: 9%;
  }
  .lion2M>div:nth-of-type(1)>p:nth-of-type(1)>i{
    color: #ff6b01;
  }
  .lion2M>div:nth-of-type(2){
    position: relative;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: #ff6b01;
    color: #fff;
    text-align: center;
  }
  .lion2M>div:nth-of-type(2)>p{
    font-size: 1.2rem;
    letter-spacing: 0.2rem;
    position: absolute;
    right: 0.85rem;
    bottom: 0.4rem;
  }
  .lion2M>div:nth-of-type(2)>img{
    width: 70%;
    height: 70%;
  }
  .compare2>p{
    color:#0099a9;
    width: 80%;
  }
  .compare2>p>i{
    border: 1px #0099a9 solid;
    padding: 0.2rem 0.3rem;
    margin-right: 0.6rem;
    line-height: 3rem;
  }
  .lion2 .time2{
    background: #fff;
    margin-top: 1rem;
    padding: 1.5rem;
  }
  .time2 img,.lists2 img{
    vertical-align: bottom;
    width: 6%;
  }
  .timeUp,.lists2{
    font-size: 1.6rem;
    color: #666;
  }
  .timeUp>img:last-child{
    float: right;
    /*color: #999;*/
    width: 4%;
  }
  .timeDown ul{
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    text-align: center;
  }
  .timeDown li{
    border: 1px solid #999999c9;
    width: 23%;
    padding: 0.2rem 0;
    color: #999999c9;
  }
  .timeDown ul:nth-of-type(1) li:nth-of-type(2){
    border: 1px solid #ffaa01;
    color: #ffaa01;
  }
  .lists2{
    background: #fff;
    margin-top: 1rem;
    padding-left: 1.5rem;
  }
  .lists2 li{
    border-bottom: 1px solid #ccc;
    padding: 1.5rem 2rem 1.5rem 0.2rem;
  }
  .lists2 li span{
    float: right;
    color: #000;
  }
  .lists2 li:nth-of-type(2) span i{
    border: 1px solid #0099a9;
    border-radius: 0.2rem;
    color: #0099a9;
    font-size: 1.2rem;
    padding: 0.2rem 0.3rem;
    margin-right: 0.5rem;
  }
  .lists2 li:nth-of-type(3) span i{
    color: #006fba;
  }
  .routerChange2{
    margin-top: 1rem;
    background: #fff;
    font-size: 1.6rem;
    display: flex;
    justify-content: space-around;
  }
  .rou2{
    padding: 1rem 0;
  }
  .server2{
    margin-top: 1rem;
  }
  .server2 img{
    width: 100%;
  }
  .relative2{
    margin-top: 1rem;
    background: #fff;
    margin-bottom: 4rem;
  }
  .relative2>p{
    font-size: 1.6rem;
    margin-right: 0.5rem;
    padding: 1rem 0 1rem 1.5rem;
  }
  .relative2>p>img{
    width: 6%;
    vertical-align: bottom;
  }
  .days2{
    margin-left: 0.5rem;
    margin-top: 1rem;
  }
  .days2 div{
    margin-top: 1rem;
    font-size: 1.4rem;
  }
  .days2 img{
    width: 5%;
  }
  .days2 p{
    margin-bottom: 1rem;
  }
  .days2 div span:nth-of-type(1){
    margin-right: 1.3rem;
  }
/*加载loding*/
#loading_box2{
  position: fixed;
  left: 50%;
  top: 50%;
  height: 100rem;
  z-index: 300;
}
  .ser_con2 {
      position: fixed;
      padding: 3% 3% 2%;
      width: 100%;
      overflow: hidden;
      z-index: 99;
  }
  .ser_con2>a>img{
    float: left;
  }
  .mid2{
    display: inline-block;
    font-size: 1.7rem;
    width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    margin-top: 0.5rem;
    margin-left: 0.5rem;
  }
  #routerChange2 .router-link-active{
    color: #ffaa01;
    border-bottom: 1px solid #ffaa01;
  }
  #routerChange2 .link-active{
    color: #ffaa01;
    border-bottom: 1px solid #ffaa01;
  }
  .flag2{
    overflow: hidden;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 100;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.2);
    text-align: center;
  }
  .flag2Wrap{
    width: 80%;
    background: #fff;
    margin: 0 auto;
    margin-top: 60%;
    border-radius: 0.5rem;
    font-size: 1.4rem;
  }
  .flag2Wrap p:nth-of-type(1){
    padding-top: 2rem;
  }
  .flag2Wrap p:nth-of-type(2){
    padding-bottom: 2rem;
  }
  .flag2Wrap ul{
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #999;

  }
  .flag2Wrap li{
    width: 49%;
    padding: 1rem 0;
  }
  .flag2Wrap li:nth-of-type(1){
    border-right: 1px solid #999;
  }
  .flag2Wrap li a{
    color: blue;
  }
  .flag2Wrap2{
    width: 100%;
    background: #fff;
    position: absolute;
    bottom: 0;
    font-size: 1.6rem;
  }
  .flag2Wrap2>div{
    padding: 2rem 0;
  }
  .flag2Wrap2>p{
    padding: 1.5rem 0;
    border-top: 1px solid #999;
  }
  .flagk-active{
    background-color: #00b0ec;
  }
  .telS2{
    display: inline-block;
    float: right;
  }
  .telS2 img{
    width: 35%;
  }
  .telS2 img:first-child{
    float: right;
  }
  .telS2 img:last-child{
    float: right;
    margin-right: 0.5rem;
  }
  .bottom2{
    width: 100%;
    display: flex;
    justify-content: space-between;
    position: fixed;
    bottom: 0;
    background: #f5f5f5;
  }
  .bottom2 img{
    width: 25%;
  }
  .bottom2>div{
    width: 35%;
    border-top: 1px solid #999;
    padding: 0.2rem 0;
    text-align: center;
    border-left: 1px solid #999;
    font-size: 1.4rem;
    color: #1296db;
  }
  .bottom2>div:first-child{
    border-left: none;
    width: 22%;
  }
  .xiangqu {
    color: #1296db;
  }
  .xiangqu img{
    width: 30%;
  }
  .bottom2>div:last-child{
    width: 41.9%;
    background: orange;
    border: none;
    font-size: 1.8rem;
    color: #fff;
    position: relative;
  }
  .bottom2>div:nth-of-type(2) img{
    width: 18%;
  }
  .bottom2>div:last-child img{
    vertical-align: bottom;
    margin-top: 6%;
  }
  .bottom2>div:last-child span{
    color: #fff;
    font-size: 1.8rem;
    line-height: 3rem;
  }

  /*分享*/
  .share2{
    display: flex;
  }
  .share2 dl{
    width: 25%;
  }
  .share2 dl img{
    width: 40%;
  }
</style>
